GlobalModulesSection Class [IIS 7 and higher]

Exposes configuration settings for IIS global modules.

Syntax

class GlobalModulesSection : ConfigurationSectionWithCollection

Methods

The following table lists the methods exposed by the GlobalModulesSection class.

Name

Description

Add

(Inherited from ConfigurationSectionWithCollection.)

Clear

(Inherited from ConfigurationSectionWithCollection.)

Get

(Inherited from ConfigurationSectionWithCollection.)

GetAllowDefinition

(Inherited from ConfigurationSection.)

GetAllowLocation

(Inherited from ConfigurationSection.)

Remove

(Inherited from ConfigurationSectionWithCollection.)

RevertToParent

(Inherited from ConfigurationSection.)

SetAllowDefinition

(Inherited from ConfigurationSection.)

SetAllowLocation

(Inherited from ConfigurationSection.)

Properties

The following table lists the properties exposed by the GlobalModulesSection class.

Name

Description

GlobalModules

An array of GlobalModuleElement objects.

Location

(Inherited from ConfigurationSection.) A key property.

Path

(Inherited from ConfigurationSection.) A key property.

SectionInformation

(Inherited from ConfigurationSection.)

Subclasses

This class contains no subclasses.

Remarks

The <globalModules> section in the ApplicationHost.config file specifies the native modules at the server level. You can enable these modules by adding their names to the <modules> section at the desired configuration level in ApplicationHost.config or in a Web.config file. In WMI, you can do this by using the Add method of the ModulesSection class.

Example

The following example lists the modules in the <globalModules> section.

' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")

' Get the ApplicationHost.config <globalModules> section.
Set oSection = oWebAdmin.Get( _
    "GlobalModulesSection.Path=" & _
    "'MACHINE/WEBROOT/APPHOST/',Location=''")

' Display the path.
WScript.Echo
WScript.Echo "Path: " & oSection.Path
WScript.Echo

' Display the global modules.
WScript.Echo "Global Modules"
WScript.Echo "--------------"
For Each oGMElement In oSection.GlobalModules
     WScript.Echo "Module: " & oGMElement.Name
     WScript.Echo "Image: " & oGMElement.Image
     WScript.Echo "PreCondition: " & oGMElement.PreCondition
     WScript.Echo
Next

Inheritance Hierarchy

ConfigurationSection

   ConfigurationSectionWithCollection

      GlobalModulesSection

Requirements

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

See Also

Reference

ConfigurationSection Class [IIS 7 and higher]

ConfigurationSectionWithCollection Class [IIS 7 and higher]

GlobalModuleElement Class [IIS 7 and higher]

ModulesSection Class [IIS 7 and higher]